<?php

namespace common;

class Posts{
	
	public $postsID;
	public $posts;
	public $datePosts;
	public $title;
	public $commentWriter;
	public $comment;

	//När det står create så skapar man en instans
	//Nollan är satt för att alltid ha ett standard värde.
	public static function Create($postsID, $posts, $datePosts, $title, $commentWriter, $comment){
		$post = new \common\Posts();
		
		if($postsID == 0){
			$post->postsID = 0;
		}else if($postsID > 0){
			$post->postsID = $postsID;
		}
	
		$post->posts = $posts;
		$post->datePosts = $datePosts;
		$post->title = $title;
		$post->commentWriter = $commentWriter;
		$post->comment = $comment;

		return $post;
	}
}
